As is known, video graphic circuitry is used in computer systems. Such video graphic circuitry functions as a co-processor to the central processing unit of the computer, wherein the video graphics circuitry processes graphical functions such as drawings, paintings, video games, etc. to produce data for display.
In a simple two-dimensional display, the video graphics circuitry receives graphical data and commands from the central processing unit and executes the commands upon the graphical data to render the two-dimensional image. Such two-dimensional images may be generated while the central processing unit is performing two-dimensional applications, such as word processing, drawing packages, presentation applications, spreadsheet applications, etc.
Video graphics circuitry is also capable of rendering three-dimensional images. To render three-dimensional images, the central processing unit provides the video graphics circuitry with commands and graphics data. The commands indicate how the video graphics circuitry is to process the graphics data to produce render three-dimensional images for subsequent display. The graphics data and/or commands may include color information, physical coordinates of object elements being rendered, texture coordinates of the object elements, alpha-blending parameters, etc. The texture coordinates are utilized to map a texture onto a particular object element as it is rendered in the physical space of the display.
When a three-dimensional image is being rendered as a perspective view, i.e., having a portion of the image appear closer and another portion of the image appear further away, MIP mapping is utilized. MIP mapping provides a plurality of texture maps wherein the first texture map is an uncompressed texture map. A second texture map of the plurality of texture maps is a four-to-one compressed texture map, where the length and width of the first texture map are each compressed by a factor of 2. The third texture map is a sixteen-to-one compressed representation of the uncompressed texture map. The plurality of texture map continues dividing the length and width of the first texture map by 2.sup.N until the compressed texture map has been compressed to a single texel.
When rendering perspective objects, the rendering circuitry of the video graphics circuit accesses one of the plurality of MIP maps based on a level of detail to retrieve the appropriate texel(s) for the current pixel being rendered. As the closer portions of the perspective objects are being rendered, the level of detail identifies the less compressed MIP maps (e.g., the uncompressed texture map, the four-to-one texture map, the sixteen-to-one texture map). When the further away portions of the perspective objects are being rendered, the level of detail indicates the more compressed MIP maps (e.g., sixteen-to-one texture map, thirty-two-to-one texture map, etc.).
Once the level of detail has been determined and a MIP map has been accessed, a set of texels is retrieved. The set of texels may be retrieved from a single MIP map which are bilinear filtered to obtain the desired texel. Alternatively, two MIP maps may be accessed to retrieve a set of texels which are trilinearly filtered to obtain the desired texel. As such, a set of texels may be filtered either by a bilinear filtering process or a trilinear filtering process.
The level of detail may be obtained by the equation .delta.a/.delta.b=(1/w)*(.delta.(a/w)/.delta.b-a(.delta.(1/w)/.delta.b)), where a equals texture coordinates in the set of {s,t} and b equals physical coordinates in the set of {x, y}. The w value is the texture scaling factor. As can be seen, this equation is a non-linear equation and requires several multiplication functions to be performed. As such, it is a rather expensive equation to implement in silicon due to the multiplication functions and the non-linearities. Thus, making it cost prohibitive implementation for commercial grade video graphic circuits.
Therefore, a need exists for a method and apparatus of determining the level of detail for texture mapping and further allows for dynamic utilization of bilinear filtering and/or tri-linear filtering.